package com.budwk.app.sqfwV2.enums.povertyMonitoring;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.stream.Collectors;

@Getter
@AllArgsConstructor
public enum FormingMaterialEnum {
    A(1,"县内务工","sqfwV2/povertyMonitoring/xnjy.xlsx","家庭成员务工检测表","sqfwV2/povertyMonitoring/template/县内务工.xlsx","/preview/povertyMonitoring/县内务工.png"),
    B(2,"县外务工","sqfwV2/povertyMonitoring/xwjy.xlsx","家庭成员务工检测表","sqfwV2/povertyMonitoring/template/县外务工.xlsx","/preview/povertyMonitoring/县外务工.png"),
    C(3,"收支情况","sqfwV2/povertyMonitoring/jtzc.xlsx","家庭收支情况采集表","ssqfwV2/povertyMonitoring/template/家庭收支情况.xlsx","/preview/povertyMonitoring/家庭收支采集表.png"),
    D(4,"台账,统计,季度","sqfwV2/povertyMonitoring/tjjd.xlsx","统计季度表","sqfwV2/povertyMonitoring/template/统计季度表.xlsx","/preview/povertyMonitoring/大Excel.png"),
    ;
    private  int code;
    private  String lable;
    private  String templat;
    private  String fileName;
    private  String blankTemplate;
    private  String previewImage;


    public static String getTemplate(Integer code){
        String templat = Arrays.asList(FormingMaterialEnum.values())
                .stream()
                .filter(e ->  code .equals(e.getCode()) )
                .collect(Collectors.toList())
                .get(0)
                .getTemplat();
        return templat;
    }
    public static String getFileName(Integer code){
        String fileName = Arrays.asList(FormingMaterialEnum.values())
                .stream()
                .filter(e -> code .equals(e.getCode()) )
                .collect(Collectors.toList())
                .get(0)
                .getFileName();
        return fileName;
    }

    public static String getBlankTemplate(Integer code){
        String blankTemplate = Arrays.asList(FormingMaterialEnum.values())
                .stream()
                .filter(e -> code .equals(e.getCode()) )
                .collect(Collectors.toList())
                .get(0)
                .getBlankTemplate();
        return blankTemplate;
    }


}
